<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
	#dv{width:200px;height:40px;border:solid 2px orange;}

	#res{width:300px;height:300px;border:solid 2px green;}

	</style>
</head>
<body>
	<div id='dv'></div>
	<div id='res'></div>

	<script type="text/javascript">
	var dv = document.getElementById('dv');

	var res = document.getElementById('res');

	var i= 10;

	
	dv.onmouseover = function()
	{
		var x = new XMLHttpRequest;

		x.onreadystatechange = function()
		{
			if(x.readyState == 4 && x.status==200)
			{
				res.innerHTML = '';
				//res.innerHTML = x.responseText;
				//创建img
				var imgs = document.createElement('img');

				imgs.setAttribute('src',x.responseText);

				res.appendChild(imgs);


			}
		}
		x.open('GET','8.php?id='+i,true);

		x.send()

		i++;
	}


	</script>
</body>
</html>